package com.yudean.esb.dao.esb;

import com.yudean.esb.domain.esb.EsbRecvServiceConfig;
import com.yudean.esb.mapper.esb.EsbRecvServiceConfigMapper;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

@Repository
public class EsbRecvServiceConfigDao {
    @Resource
    private EsbRecvServiceConfigMapper esbRecvServiceConfigMapper;

    public List<EsbRecvServiceConfig> getAll() {
        List<EsbRecvServiceConfig> list = esbRecvServiceConfigMapper.select();
        if (list == null || list.size() < 1)
            return null;
        return list;
    }

    public EsbRecvServiceConfig get(String ID) {
        if (ID == null)
            return null;
        else
            return esbRecvServiceConfigMapper.selectOne(ID);
    }

    public EsbRecvServiceConfig getByServiceID(String serviceID) {
        if (serviceID == null)
            return null;
        else
            return esbRecvServiceConfigMapper.selectByServiceID(serviceID);

    }

    public void insert(EsbRecvServiceConfig config) {
        esbRecvServiceConfigMapper.insert(config);
    }

    public void update(EsbRecvServiceConfig config) {
        esbRecvServiceConfigMapper.update(config);
    }

    public void delete(EsbRecvServiceConfig config) {
        esbRecvServiceConfigMapper.delete(config);
    }

}
